<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core" 
                xmlns:ui="http://java.sun.com/jsf/facelets" 
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                template="/prot/principal.xhtml">


    <ui:define name="content">  

        <!-- Main bar -->
        <div class="mainbar">

            <!-- Page heading -->
            <div class="page-head">
                <!-- Page heading -->
                <h2 class="pull-left">#{ctrPelicula.opcionEdicion} Pelicula
                    <!-- page meta -->
                    <span class="page-meta">Mantenimiento</span>
                </h2>


                <!-- Breadcrumb -->
                <div class="bread-crumb pull-right">
                    <a href="../prot/entrada.xhtml"><i class="icon-home"></i> Home</a> 
                    <!-- Divider -->
                    <span class="divider">/</span> 
                    <a href="listPeliculas.xhtml" class="bread-current">Pelicula</a>
                    <!-- Divider -->
                    <span class="divider">/</span> 
                    <a href="frmPelicula.xhtml" class="bread-current">#{ctrPelicula.opcionEdicion}</a>
                </div>

                <div class="clearfix"></div>

            </div>
            <!-- Page heading ends -->



            <!-- Matter -->

            <div class="matter">
                <div class="container">

                    <div class="row">
                        <div class="col-md-12">

                            <div class="widget wred">
                                <div class="widget-head">
                                    <div class="pull-left">Datos de la Pelicula</div>
                                    <div class="widget-icons pull-right">
                                        <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> 
                                        <a href="#" class="wclose"><i class="icon-remove"></i></a>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>

                                <div class="widget-content">
                                    <div class="padd">



                                        <div class="form profile">



                                            <!-- Nombre -->
                                            <div class="form-group">
                                                <label class="control-label col-lg-3" for="unombre">#{msg.nombre}</label>
                                                <div class="col-lg-6">

                                                    <h:inputText  id="unombre" value="#{ctrPelicula.pelicula.nombre}"
                                                                  required="true" requiredMessage="#{msg.camporequerido}" 
                                                                  styleClass="form-control" maxlength="100"
                                                                  />
                                                    <rich:message for="unombre"  ajaxRendered="true"/>
                                                </div>

                                            </div>


                                            <!-- Director -->
                                            <div class="form-group">
                                                <label class="control-label col-lg-3" for="udirector">Director</label>
                                                <div class="col-lg-6">

                                                    <h:inputText  id="udirector" value="#{ctrPelicula.pelicula.director}"
                                                                  required="true" requiredMessage="#{msg.camporequerido}" 
                                                                  styleClass="form-control" maxlength="100"
                                                                  />
                                                    <rich:message for="udirector"  ajaxRendered="true"/>
                                                </div>

                                            </div>




                                            <!-- Fecha -->
                                            <div class="form-group">
                                                <label class="control-label col-lg-3" for="unombre">#{msg.fecha} de Estreno</label>
                                                <div class="col-lg-6">

                                                    <a4j:outputPanel layout="block">
                                                        <rich:calendar value="#{ctrPelicula.pelicula.fechaEstreno}" id="calendar" locale="en/US"
                                                                       popup="true" datePattern="MMM d, yyyy"
                                                                       showApplyButton="false" style="width:200px"
                                                                       disabled="false">
                                                        </rich:calendar>
                                                    </a4j:outputPanel>

                                                    <rich:message for="ufecha"  ajaxRendered="true"/>
                                                </div>

                                            </div>  




                                            <!-- Precio -->
                                            <div class="form-group">
                                                <label class="control-label col-lg-3" for="uprecio">Precio</label>
                                                <div class="col-lg-6">

                                                    <h:inputText  id="uprecio" value="#{ctrPelicula.pelicula.precioAlquiler}"
                                                                  required="true" requiredMessage="#{msg.camporequerido}" 
                                                                  styleClass="form-control" maxlength="100"
                                                                  />
                                                    <rich:message for="uprecio"  ajaxRendered="true"/>
                                                </div>

                                            </div>




                                            <!-- VideoClub -->
                                            <div class="form-group">
                                                <label class="control-label col-lg-3" for="uvideo">VideoClub</label>
                                                <div class="col-lg-3">

                                                    <h:selectOneMenu id="uvideo" value="#{ctrPelicula.pelicula.sel_VideoClub}"
                                                                     required="true" requiredMessage="#{msg.camporequerido}"
                                                                     styleClass="texto" disabled="true"
                                                                     >

                                                        <f:selectItems value="#{ctrPelicula.lstItemsVideoClub}" />

                                                    </h:selectOneMenu>
                                                    <rich:message for="uvideo" ajaxRendered="true"/>
                                                </div>

                                            </div>



                                            <rich:messages    ajaxRendered="true"/>



                                            <div class="form-group">
                                                <!-- Buttons -->
                                                <div class="col-lg-6 col-lg-offset-1">

                                                    <h:commandButton  type="submit"  class="btn btn-success" value="#{ctrPelicula.opcionBoton}" action="#{ctrPelicula.grabar()}" /> 
                                                    <h:commandButton  type="submit"  class="btn btn-default"  value="#{msg.cancelar}" action="#{ctrPelicula.irListado()}" immediate="true" /> 
                                                </div>
                                            </div>     


                                        </div>



                                    </div>
                                </div>



                            </div>


                        </div>


                    </div>

                </div>
            </div>

            <!-- Matter ends -->

        </div>

        <!-- Mainbar ends -->
    </ui:define>
</ui:composition>